<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Math对象</title>
</head>
<body>
    <script>
        const num = 1.6;
        console.log("num:",num);
        console.log("向上取整",Math.ceil(num))
        console.log("向下取整",Math.floor(num))
        console.log("四舍五入",Math.round(num))

        let rNum = Math.random();
        console.log("随机数:",rNum)
        //生成1-100
        console.log("1-100",Math.floor(rNum*100)+1);
        console.log("2-99",Math.floor(rNum*98)+2);
    </script>
</body>
</html>